package com.qf.springMybatisRandomUser.until;

import java.io.File;
import java.io.IOException;

/**
 * @author 刘欣
 * @createTime 2023/1/2 18:23
 * @description
 */
public class FileUntil {
    private static File file;
    private static String path = "src/main/resources/users.cvs";

    static {
        file = new File(path);
        if (!file.exists()) {
            try {
                file.createNewFile();
            } catch (IOException e) {
                System.out.println("文件已存在！");
            }
        }
    }

    public static File getFile() {
        File touch = cn.hutool.core.io.FileUtil.touch("src/main/resources/users.cvs");
        return file;
    }

    public static String getPath() {
        return file.getAbsolutePath();
    }

}
